﻿namespace CSharpPro._11月3日作业.service.impl;

public class UserServiceImpl : UserService
{
    private UserService _userServiceImplementation;

    public static User rigite()
    {
        User rigite = new User();
        Console.WriteLine("rigite");
        Console.WriteLine("输入用户名");
        rigite.Username=Console.ReadLine();
        Console.WriteLine("请输入密码");
        rigite.Password=Console.ReadLine();
        return rigite;
    }

    


    public static void login(Dictionary<string,User> dict,User user)
    {
        if (dict.TryGetValue(user.Username, out User u))
        {
            if (u.Password == user.Password)
            {
                font();
            }
            else
            {
                Console.WriteLine("账号或密码错误");
            }
        }
        else
        {
            Console.WriteLine("账号不存在");
        }
    }

    public static void font()
    {
        Console.WriteLine("登录成功");
    }
}